C (281/301)

From:andrewmarkwell
Date:24 Aug 99 at 17:28:49
Subject:Re: Text Boxes

From: andrewmarkwell@ukonline.co.uk

>From: Laura Vance <vancel@amiga.nols.com>
>
>Hi again,
..

>I have made a program that uses a separate window to display some text.
>The text is too long to fit on one line in a window, and it looks nicer to
>have it wrap around the edge for another line. I couldn't find a text box
>style gadget within the system libraries (one might be there, but I didn't
>find it) I tried making a regular text box from the gadtools.library large
>enough to hold it, but all the larger text box did was still let the text
>flow out of the other side. I wrote a small function to count the
>characters based on the width of the font and try to wrap them at the
>appropriate time, and it works with some fonts, but I would prefer to let
>the system handle that.

You could try making each word a separate IntuiText. Then work out
separately where to position each word. The functions IntuiTextLength() and
PrintIText will be useful. You can work out font heights from
IntuiText->ITextFont->ta_YSize.

Andrew Markwell